]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Adjust to MetaCursor changes
authorSebastian Wick <sebastian.wick@redhat.com>
Fri, 31 Jan 2025 15:47:10 +0000 (16:47 +0100)
committerSebastian Wick <sebastian.wick@redhat.com>
Tue, 18 Feb 2025 21:20:41 +0000 (22:20 +0100)
js/ui/dnd.js
js/ui/messageList.js
js/ui/screenshot.js
src/shell-global.c

index 3250620c3b1085a9d2eab6659ab9167532d02851..63a279b4bf5db44d957ddf5d0d243fa70a4bb0f7 100644 (file)
@@ -31,9 +31,9 @@ const DragState = {
 };
 
 const DRAG_CURSOR_MAP = {
-    0: Meta.Cursor.DND_UNSUPPORTED_TARGET,
-    1: Meta.Cursor.DND_COPY,
-    2: Meta.Cursor.DND_MOVE,
+    0: Meta.Cursor.NO_DROP,
+    1: Meta.Cursor.COPY,
+    2: Meta.Cursor.MOVE,
 };
 
 export const DragDropResult = {
@@ -386,7 +386,7 @@ class _Draggable extends Signals.EventEmitter {
             this._ungrabActor();
 
         this._grabEvents(device, sequence);
-        global.display.set_cursor(Meta.Cursor.DND_IN_DRAG);
+        global.display.set_cursor(Meta.Cursor.NO_DROP);
 
         this._dragX = this._dragStartX = stageX;
         this._dragY = this._dragStartY = stageY;
@@ -628,7 +628,7 @@ class _Draggable extends Signals.EventEmitter {
             }
             target = target.get_parent();
         }
-        global.display.set_cursor(Meta.Cursor.DND_IN_DRAG);
+        global.display.set_cursor(Meta.Cursor.NO_DROP);
         return GLib.SOURCE_REMOVE;
     }
 
index 2774519f3bf5c1f7dc89f0267a532fb9b1c01cff..8ac1564838bd31393faabcbbb9d97619e8f0eab4 100644 (file)
@@ -92,7 +92,7 @@ class URLHighlighter extends St.Label {
 
         const urlId = this._findUrlAtPos(event);
         if (urlId !== -1 && !this._cursorChanged) {
-            global.display.set_cursor(Meta.Cursor.POINTING_HAND);
+            global.display.set_cursor(Meta.Cursor.POINTER);
             this._cursorChanged = true;
         } else if (urlId === -1) {
             global.display.set_cursor(Meta.Cursor.DEFAULT);
index da5a7f85d8a31c5fe16b36a3e40c271b0d2c7a02..e3bd5495f114815e17a5987d473cee9bdaa87422 100644 (file)
@@ -355,21 +355,21 @@ const UIAreaSelector = GObject.registerClass({
             else if (y - bottomY >= 0 && y - bottomY <= threshold)
                 return Meta.Cursor.SW_RESIZE;
             else if (topY - y < 0 && y - bottomY < 0)
-                return Meta.Cursor.WEST_RESIZE;
+                return Meta.Cursor.W_RESIZE;
         } else if (x - rightX >= 0 && x - rightX <= threshold) {
             if (topY - y >= 0 && topY - y <= threshold)
                 return Meta.Cursor.NE_RESIZE;
             else if (y - bottomY >= 0 && y - bottomY <= threshold)
                 return Meta.Cursor.SE_RESIZE;
             else if (topY - y < 0 && y - bottomY < 0)
-                return Meta.Cursor.EAST_RESIZE;
+                return Meta.Cursor.E_RESIZE;
         } else if (leftX - x < 0 && x - rightX < 0) {
             if (topY - y >= 0 && topY - y <= threshold)
-                return Meta.Cursor.NORTH_RESIZE;
+                return Meta.Cursor.N_RESIZE;
             else if (y - bottomY >= 0 && y - bottomY <= threshold)
-                return Meta.Cursor.SOUTH_RESIZE;
+                return Meta.Cursor.S_RESIZE;
             else if (topY - y < 0 && y - bottomY < 0)
-                return Meta.Cursor.MOVE_OR_RESIZE_WINDOW;
+                return Meta.Cursor.MOVE;
         }
 
         return Meta.Cursor.CROSSHAIR;
@@ -461,7 +461,7 @@ const UIAreaSelector = GObject.registerClass({
 
             // For moving, start X and Y are the top left corner, while
             // last X and Y are the bottom right corner.
-            if (cursor === Meta.Cursor.MOVE_OR_RESIZE_WINDOW) {
+            if (cursor === Meta.Cursor.MOVE) {
                 this._startX = leftX;
                 this._startY = topY;
                 this._lastX = rightX;
@@ -471,25 +471,25 @@ const UIAreaSelector = GObject.registerClass({
             // Start X and Y are set to the stationary sides, while last X
             // and Y are set to the moving sides.
             if (cursor === Meta.Cursor.NW_RESIZE ||
-                cursor === Meta.Cursor.WEST_RESIZE ||
+                cursor === Meta.Cursor.W_RESIZE ||
                 cursor === Meta.Cursor.SW_RESIZE) {
                 this._startX = rightX;
                 this._lastX = leftX;
             }
             if (cursor === Meta.Cursor.NE_RESIZE ||
-                cursor === Meta.Cursor.EAST_RESIZE ||
+                cursor === Meta.Cursor.E_RESIZE ||
                 cursor === Meta.Cursor.SE_RESIZE) {
                 this._startX = leftX;
                 this._lastX = rightX;
             }
             if (cursor === Meta.Cursor.NW_RESIZE ||
-                cursor === Meta.Cursor.NORTH_RESIZE ||
+                cursor === Meta.Cursor.N_RESIZE ||
                 cursor === Meta.Cursor.NE_RESIZE) {
                 this._startY = bottomY;
                 this._lastY = topY;
             }
             if (cursor === Meta.Cursor.SW_RESIZE ||
-                cursor === Meta.Cursor.SOUTH_RESIZE ||
+                cursor === Meta.Cursor.S_RESIZE ||
                 cursor === Meta.Cursor.SE_RESIZE) {
                 this._startY = topY;
                 this._lastY = bottomY;
@@ -542,7 +542,7 @@ const UIAreaSelector = GObject.registerClass({
             let dx = Math.round(x - this._dragStartX);
             let dy = Math.round(y - this._dragStartY);
 
-            if (this._dragCursor === Meta.Cursor.MOVE_OR_RESIZE_WINDOW) {
+            if (this._dragCursor === Meta.Cursor.MOVE) {
                 const [,, selectionWidth, selectionHeight] = this.getGeometry();
 
                 let newStartX = this._startX + dx;
@@ -584,11 +584,11 @@ const UIAreaSelector = GObject.registerClass({
                 this._lastX = newLastX;
                 this._lastY = newLastY;
             } else {
-                if (this._dragCursor === Meta.Cursor.WEST_RESIZE ||
-                    this._dragCursor === Meta.Cursor.EAST_RESIZE)
+                if (this._dragCursor === Meta.Cursor.W_RESIZE ||
+                    this._dragCursor === Meta.Cursor.E_RESIZE)
                     dy = 0;
-                if (this._dragCursor === Meta.Cursor.NORTH_RESIZE ||
-                    this._dragCursor === Meta.Cursor.SOUTH_RESIZE)
+                if (this._dragCursor === Meta.Cursor.N_RESIZE ||
+                    this._dragCursor === Meta.Cursor.S_RESIZE)
                     dx = 0;
 
                 // Make sure last X and Y are clamped between 0 and size - 1,
@@ -619,16 +619,16 @@ const UIAreaSelector = GObject.registerClass({
                         this._dragCursor = Meta.Cursor.NE_RESIZE;
                     else if (this._dragCursor === Meta.Cursor.SW_RESIZE)
                         this._dragCursor = Meta.Cursor.SE_RESIZE;
-                    else if (this._dragCursor === Meta.Cursor.WEST_RESIZE)
-                        this._dragCursor = Meta.Cursor.EAST_RESIZE;
+                    else if (this._dragCursor === Meta.Cursor.W_RESIZE)
+                        this._dragCursor = Meta.Cursor.E_RESIZE;
                 } else {
                     // eslint-disable-next-line no-lonely-if
                     if (this._dragCursor === Meta.Cursor.NE_RESIZE)
                         this._dragCursor = Meta.Cursor.NW_RESIZE;
                     else if (this._dragCursor === Meta.Cursor.SE_RESIZE)
                         this._dragCursor = Meta.Cursor.SW_RESIZE;
-                    else if (this._dragCursor === Meta.Cursor.EAST_RESIZE)
-                        this._dragCursor = Meta.Cursor.WEST_RESIZE;
+                    else if (this._dragCursor === Meta.Cursor.E_RESIZE)
+                        this._dragCursor = Meta.Cursor.W_RESIZE;
                 }
 
                 if (this._lastY > this._startY) {
@@ -636,16 +636,16 @@ const UIAreaSelector = GObject.registerClass({
                         this._dragCursor = Meta.Cursor.SW_RESIZE;
                     else if (this._dragCursor === Meta.Cursor.NE_RESIZE)
                         this._dragCursor = Meta.Cursor.SE_RESIZE;
-                    else if (this._dragCursor === Meta.Cursor.NORTH_RESIZE)
-                        this._dragCursor = Meta.Cursor.SOUTH_RESIZE;
+                    else if (this._dragCursor === Meta.Cursor.N_RESIZE)
+                        this._dragCursor = Meta.Cursor.S_RESIZE;
                 } else {
                     // eslint-disable-next-line no-lonely-if
                     if (this._dragCursor === Meta.Cursor.SW_RESIZE)
                         this._dragCursor = Meta.Cursor.NW_RESIZE;
                     else if (this._dragCursor === Meta.Cursor.SE_RESIZE)
                         this._dragCursor = Meta.Cursor.NE_RESIZE;
-                    else if (this._dragCursor === Meta.Cursor.SOUTH_RESIZE)
-                        this._dragCursor = Meta.Cursor.NORTH_RESIZE;
+                    else if (this._dragCursor === Meta.Cursor.S_RESIZE)
+                        this._dragCursor = Meta.Cursor.N_RESIZE;
                 }
 
                 global.display.set_cursor(this._dragCursor);
@@ -3047,7 +3047,7 @@ class PickPixel extends St.Widget {
     }
 
     async pickAsync() {
-        global.display.set_cursor(Meta.Cursor.BLANK);
+        global.display.set_cursor(Meta.Cursor.NONE);
         Main.uiGroup.set_child_above_sibling(this, null);
         this.show();
 
index 9e73d25f408332b6c568cf1dbb8f2f928f018926..c941701b618e48ad0f87a65d7dd48fa1d4af07a6 100644 (file)
@@ -1007,7 +1007,7 @@ entry_cursor_func (StEntry  *entry,
   ShellGlobal *global = user_data;
 
   meta_display_set_cursor (global->meta_display,
-                           use_ibeam ? META_CURSOR_IBEAM : META_CURSOR_DEFAULT);
+                           use_ibeam ? META_CURSOR_TEXT : META_CURSOR_DEFAULT);
 }
 
 #ifdef HAVE_X11